Intentions

This is intended as a minimal viable product, to pre-run and troubleshoot with a smaller data set. Data size: 489 rodent species out of 2200 species. (Final version will probably have 900 - 1100 data points, 50% of all Rodentia species) Goals: 1.Find the consensus Rodentia tree 2.Do ancestral state reconstruction and plot. 3.Find out other tests of interest to run.

Plot the consensus tree

I realize that 1000 trees are not sufficient to resolve the phylogeny, as shown below. Therefore I did ancestral state reconstruction on a randomly chosen tree. For the final version, I plan to run on 10,000 trees. I will settle with a random tree for now because 10,000 trees takes significantly longer time to process.

  tree_readin = read.nexus('1028_output.nex')
  tree2 = random.tree<-sample(tree_readin,size=1)[[1]]
  #print(tree2)
  #plot(tree2)
  
  consensusTree = consensus(tree_readin, p = 0.5, check.labels = FALSE)
  plot(consensusTree)

Ancestral State Reconstruction

# Character state matrix 
charstate = read.csv('1028_MVP2.csv', row.names = 1)
charstate = as.matrix(charstate)[,1]

#plotTree(tree2, type = 'fan', ftype = 'i', fsize = 1)
result = ace(charstate, tree2, type = 'continuous', method = 'ML')
contresult = contMap(tree2, charstate, plot = FALSE)
plot(contresult, lwd = 5, legend = 0.7 * max(nodeHeights(tree2)),outline = 0) # fsize = c(0.5, 0.5)